package com.wss.service.impl;

import com.wss.dao.RankMapper;
import com.wss.domain.RankTest;
import com.wss.service.RankService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RankServiceImpl implements RankService {

    @Autowired
    private RankMapper rankMapper;
    @Override
    public int rankOfSongListId(Long songListId) {
        return rankMapper.selectScoreSum(songListId)/rankMapper.selectRankNum(songListId);
    }

    @Override
    public boolean addRank(RankTest rankTest) {
        return rankMapper.insertSelective(rankTest)>0?true:false;
    }
}
